//
//  Call.h
//  jmGouTong
//
//  Created by 王大虎 on 2022/9/22.
//  Copyright © 2022 seclery. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void(^success)(BOOL);
typedef void(^Callback)(void);
typedef enum : NSUInteger {
    connecting,
    active,
    held,
    ended
} CallState;

typedef enum : NSUInteger {
    pending,
    complete
} ConnectedState;
NS_ASSUME_NONNULL_BEGIN

@interface Call : NSObject
@property (strong, nonatomic) NSUUID * uuid;
@property (assign, nonatomic) BOOL outgoing;
@property (strong, nonatomic) NSString * handle;
@property (assign, nonatomic) BOOL isAudioCall;

@property (assign, nonatomic) CallState state;
@property (assign, nonatomic) ConnectedState connectedState;


@property (nonatomic, copy) Callback stateChanged;
@property (nonatomic, copy) Callback connectedStateChanged;

- (instancetype)initWithUUID:(NSUUID*)uuid isOutgoing:(BOOL)outgoing handle:(NSString *)handle isAudioCall:(BOOL)isAudioCall;

-(void)start:(success)completion;

-(void)answer;

-(void)end;




@end

NS_ASSUME_NONNULL_END
